﻿<%@ Page Title="" Language="VB" MasterPageFile="~/MasterPage.master" AutoEventWireup="false"
    CodeFile="WFAgentMaintain.aspx.vb" Inherits="WFAgentMaintain" %>

<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
            <asp:HiddenField ID="hiUID" runat="server" />
            <asp:HiddenField ID="hidbName" runat="server" />
            <asp:ObjectDataSource ID="dbWFAgent" runat="server" SelectMethod="GetData" TypeName="WorkFlow.BBL.WFAgntBBL"
                InsertMethod="InsertData" UpdateMethod="UpdateData">
                <UpdateParameters>
                    <asp:ControlParameter ControlID="hiUID" Name="UID" PropertyName="Value" 
                        Type="String" />
                    <asp:Parameter Name="Agent" Type="String" />
                    <asp:Parameter Name="StartDate" Type="DateTime" />
                    <asp:Parameter Name="EndDate" Type="DateTime" />
                    <asp:Parameter Name="Status" Type="String" />
                    <asp:Parameter Name="SeqNo" Type="Int32" />
                    <asp:ControlParameter ControlID="hidbName" Name="dbName" PropertyName="Value" 
                        Type="String" />
                </UpdateParameters>
                <SelectParameters>
                    <asp:ControlParameter ControlID="hiUID" Name="UID" PropertyName="Value" Type="String" />
                    <asp:ControlParameter ControlID="hidbName" ConvertEmptyStringToNull="False" Name="dbName"
                        PropertyName="Value" Type="String" />
                </SelectParameters>
                <InsertParameters>
                    <asp:ControlParameter ControlID="hiUID" Name="UID" PropertyName="Value" Type="String" />
                    <asp:ControlParameter ControlID="txtAgent" Name="Agent" PropertyName="Text" 
                        Type="String" />
                    <asp:ControlParameter ControlID="txtStartDate" Name="StartDate" PropertyName="Text"
                        Type="DateTime" />
                    <asp:ControlParameter ControlID="txtEndDate" Name="EndDate" PropertyName="Text" Type="DateTime" />
                    <asp:ControlParameter ControlID="hidbName" Name="dbName" PropertyName="Value" Type="String" />
                </InsertParameters>
            </asp:ObjectDataSource>
            <table border="1" width="1000px">
                <tr>
                    <td style="text-align: center">
                        <asp:Label ID="lblTitle" runat="server" meta:resourcekey="lblTitle"  SkinID="title"
                           ></asp:Label>
                    </td>
                </tr>
                <tr>
                    <td>
                        <asp:Button ID="btnInsert" runat="server" meta:resourcekey="btnInsert" />
                    </td>
                </tr>
                <tr>
                    <td>
                        <TServerControl:TGridView ID="gvWFAgent" runat="server" AllowHoverEffect="False"
                            AllowHoverSelect="False" AllowPaging="True" AutoGenerateColumns="False" ShowFooterWhenEmpty="False"
                            ShowHeaderWhenEmpty="True" SkinID="pager" TotalRowCount="0" Width="100%" DataSourceID="dbWFAgent">
                            <Columns>
                            <asp:TemplateField >
                                    <EditItemTemplate>
                                        <asp:LinkButton ID="btnUpdate"  CommandName="Update" runat="server" meta:resourcekey="btnUpdate"></asp:LinkButton>
                                        <asp:LinkButton ID="btnCancel" CommandName="Cancel" runat="server" meta:resourcekey="btnCancel2"></asp:LinkButton>
                                    </EditItemTemplate>
                                    <ItemTemplate>
                                        <asp:LinkButton ID="btnEdit" CommandName ="Edit" runat="server" meta:resourcekey="btnEdit"></asp:LinkButton>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                
                               
                                <asp:TemplateField meta:resourcekey="colUID">
                                    <EditItemTemplate>
                                        <asp:TextBox ID="txtAgent1" runat="server" Text='<%# Bind("Agent") %>' Width ="80px"></asp:TextBox>
                                        <asp:LinkButton ID="btnAgent1"  CommandName ="Agent"  runat="server">...</asp:LinkButton>
                                    </EditItemTemplate>
                                    <ItemTemplate>
                                        <asp:Label ID="Label1" runat="server" Text='<%# Bind("Agent") %>'></asp:Label>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:BoundField DataField="Agentname" meta:resourcekey="colemp_name"  ReadOnly="True" />
                                <asp:BoundField DataField="SeqNo" meta:resourcekey="colSeqNo"  ReadOnly="True" />
                                <asp:TemplateField meta:resourcekey="colStatus">
                                    <EditItemTemplate>
                                        <asp:DropDownList ID="ddlStatus" runat="server" Width="53px" 
                                            SelectedValue='<%# Bind("Status") %>' >
                                            <asp:ListItem>Y</asp:ListItem>
                                            <asp:ListItem>N</asp:ListItem>
                                        </asp:DropDownList>
                                        <asp:HiddenField ID="hiSeqNo" runat="server" Value='<%# Bind("SeqNo") %>' />
                                    </EditItemTemplate>
                                    <ItemTemplate>
                                        <asp:Label ID="lblStatus" runat="server" Text='<%# Bind("Status") %>'></asp:Label>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField meta:resourcekey="colStartDate">
                                    <EditItemTemplate>
                                        <asp:TextBox ID="txtStartDate" runat="server" Text='<%# Bind("StartDate" ,"{0:yyyy/MM/dd HH:mm}") %>'></asp:TextBox>
                                    </EditItemTemplate>
                                    <ItemTemplate>
                                        <asp:Label ID="Label2" runat="server" 
                                            Text='<%# Bind("StartDate", "{0:yyyy/MM/dd HH:mm}") %>'></asp:Label>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField meta:resourcekey="colEndDate" >
                                    <EditItemTemplate>
                                        <asp:TextBox ID="txtEndDate" runat="server" Text='<%# Bind("EndDate","{0:yyyy/MM/dd HH:mm}") %>'></asp:TextBox>
                                    </EditItemTemplate>
                                    <ItemTemplate>
                                        <asp:Label ID="Label3" runat="server" 
                                            Text='<%# Bind("EndDate", "{0:yyyy/MM/dd HH:mm}") %>'></asp:Label>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:BoundField DataField="CrtDate" meta:resourcekey="colCrtDate" DataFormatString="{0:yyyy/MM/dd}"  ReadOnly="True" />
                                <asp:BoundField DataField="CrtName" meta:resourcekey="colCrtUID"  ReadOnly="True"  />
                                <asp:BoundField DataField="ModiDate" meta:resourcekey="colModiDate"  ReadOnly="True" DataFormatString="{0:yyyy/MM/dd}" />
                                <asp:BoundField DataField="ModiName" meta:resourcekey="colModiUID"   ReadOnly="True" />
                                
                            </Columns>
                        </TServerControl:TGridView>
                    </td>
                </tr>
            </table>
            <asp:Panel ID="plInsert" runat="server" BackColor="#E7FEC2" Height="100px" Width="800px">
                <table width ="100%">
                    <tr>
                        <td align="right" style="height: 37px">
                            <asp:Label ID="lblAgent" runat="server" meta:resourcekey="lblAgent"></asp:Label>
                        </td>
                        <td style="height: 37px">
                            <asp:TextBox ID="txtAgent" runat="server" Width="80px"></asp:TextBox>
                            <asp:LinkButton ID="btnAgent" runat="server">...</asp:LinkButton>
                        </td>
                        <td align="right" style="height: 37px">
                            <asp:Label ID="lblStartDate" runat="server" meta:resourcekey="lblStartDate"></asp:Label>
                        </td>
                        <td style="height: 37px">
                            <asp:TextBox ID="txtStartDate" runat="server"></asp:TextBox>
                            ~~<asp:TextBox ID="txtEndDate" runat="server"></asp:TextBox></td>
                    </tr>
                    <tr>
                        <td align="center" colspan="4">
                            <asp:Button ID="btnSave" runat="server" meta:resourcekey="btnSave" 
                                style="height: 19px" />
                            <asp:Button ID="btnCancel" runat="server" meta:resourcekey="btnCancel" />
                        </td>
                    </tr>
                </table>
            </asp:Panel>
            <ajaxToolkit:ModalPopupExtender ID="mpIns" runat="server" PopupControlID="plInsert"
                TargetControlID="btnInsert" PopupDragHandleControlID="plInsert" CancelControlID="btnCancel"
                X="20" Y="50" BehaviorID="mpIns">
            </ajaxToolkit:ModalPopupExtender>
        </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>
